
version 15
capture log close
set more off
clear
clear matrix
clear mata

if c(username)=="WB485280" {
		glo rootdir		"C:\Users\wb485280\OneDrive - WBG\radicalization"
		}
if c(username)=="WB382635" {
		glo rootdir		"C:\Users\wb382635\Dropbox\Unemp & daesh"
		}
if c(username)=="WB452275" {
		glo rootdir		"C:\Users\WB452275\Dropbox\Projects\Unemp & daesh"
		}
if c(username)=="sarurchaudhary" {
		glo rootdir		"/Users/sarurchaudhary/Dropbox/Unemp & daesh"
		}
if c(username)=="kartikabhatia" {
			glo rootdir		"/Users/kartikabhatia/Dropbox/Before2019/Unemp & daesh"
			}
			
		glo	datadir     "${rootdir}/Data/Raw data"
		glo outdir		"${rootdir}/Data/Working datasets"
		glo dodir		"${rootdir}/Dofiles"
        
		cd "${outdir}"
		
	    log using pewmus_prep, replace t

* ------------------------------------------------------------------------------
* Date : July 2017 [chkd oct 2021]


* Project : Mena Economic Monitor, Fall 2016 edition (MNACE, The World Bank)


* This do file prepares the WDI database for merge

* Database used : pew_raw.dta


* Output : pewmus.dta

* ------------------------------------------------------------------------------





// PREP PEW MUSLIM DATA
	    
use "${datadir}/pew_raw.dta", clear
sort countryname year
		
replace countryname ="Egypt, Arab Rep." if countryname =="Egypt"
replace countryname ="Gambia, The" if countryname =="Gambia"
replace countryname ="Hong Kong SAR, China" if countryname=="Hong Kong"
replace countryname ="Iran, Islamic Rep." if countryname=="Iran"
replace countryname ="Kyrgyz Republic" if countryname=="Kyrgystan"
replace countryname ="Lao PDR" if countryname=="Laos"
replace countryname ="Macedonia, FYR" if countryname=="Macedonia"
replace countryname ="Russian Federation" if countryname=="Russia"
replace countryname ="Syrian Arab Republic" if countryname=="Syria"
replace countryname ="Venezuela, RB" if countryname=="Venezuela"
replace countryname ="Yemen, Rep." if countryname=="Yemen"
replace countryname ="Tajikistan" if countryname=="Tajikestan"

*correcting Bulgaria's muslim pop
replace pew_muslims_n=577000 if countryname=="Bulgaria"

sort countryname year
save "${outdir}/pewmus.dta", replace 

log close
